package com.codegeek.project.slope.domain;

import com.codegeek.common.utils.ReplaceIllegalChar;
import com.codegeek.framework.aspectj.lang.annotation.Excel;
import com.codegeek.framework.web.domain.BaseEntity;
import lombok.Data;

import java.util.Date;
import java.util.List;

/**
 * 订阅详情对象 slope_subscribe_detail
 *
 * @author codegeek
 * @date 2020-02-17
 */
@Data
public class SlopeSubscribeDetail extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * ID
     */
    private Long subscribeDetailId;

    /**
     * 告警信息
     */
    @Excel(name = "告警信息")
    private SlopeAlarm alarm;

    /**
     * 订阅人
     */
    @Excel(name = "订阅人")
    private String subscriber;

    /**
     * 推送时间
     */
    @Excel(name = "推送时间", width = 30, dateFormat = "yyyy-MM-dd")
    private Date sendTime;

    /**
     * 推送信息
     */
    @Excel(name = "推送信息")
    private String message;

    private List<SlopeSubscriber> slopeSubscribers;

    private String userName;

    public SlopeSubscribeDetail setSlopeSubscribers(List<SlopeSubscriber> slopeSubscribers) {
        this.slopeSubscribers = slopeSubscribers;
        return this;
    }

    public void setSubscriber(String subscriber) {
        this.subscriber = new ReplaceIllegalChar().replace(subscriber);
    }

    public void setMessage(String message) {
        this.message = new ReplaceIllegalChar().replace(message);
    }

    public void setUserName(String userName) {
        this.userName = new ReplaceIllegalChar().replace(userName);
    }
}
